//package com.auth.service.impl;
//
//import com.auth.service.KeyPairService;
//import com.nimbusds.jose.jwk.JWKSet;
//import com.nimbusds.jose.jwk.RSAKey;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.security.KeyPair;
//import java.security.interfaces.RSAPublicKey;
//import java.util.Map;
//
//@Service
//public class KetPairServiceImpl implements KeyPairService {
//    @Autowired
//    private KeyPair keyPair;
//
//    @Override
//    public Map<String, Object> getKey() {
//        RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic();
//        RSAKey key = new RSAKey.Builder(publicKey).build();
//        return new JWKSet(key).toJSONObject();
//    }
//}
